home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / inkey4c.zip / INKEY.H < prev    next >
Text File  |  1993-03-16  |  8KB  |  226 lines

  1. /*  ********************************************************************* */
  2. /*                                                                        */
  3. /*                 INKEY.H version 1.0                        */
  4. /*                                                                        */
  5. /*  ********************************************************************* */
  6. /*        Copyright 1993 by John H. Traphofner, Esq.                */
  7. /*                                                                        */
  8. /*  ********************************************************************* */
  9. #define EXTENDED     +256
  10. #define STATUS        512
  11. #define KEY_101_TEST    STATUS
  12. #define READ_KEY        0
  13.  
  14. unsigned int KEY_WAIT=2048;    /*    GLOBAL KEY_WAIT variable  */
  15.  
  16. unsigned int inkey(unsigned int jht_keypress);
  17.  
  18.  
  19. /*     The Status functions 1-8  are available on all keyboards.      */
  20. /*      Status functions 9-16 are only available on 101 keyboards. */
  21. /*      Use inkey(STATUS) to determine type of keyboard.           */
  22.  
  23.  
  24. #define ALT_PRESSED     ( 1+STATUS)
  25. #define CTRL_PRESSED     ( 2+STATUS)
  26. #define LSHIFT_PRESSED     ( 3+STATUS)
  27. #define RSHIFT_PRESSED     ( 4+STATUS)
  28. #define SHIFT_PRESSED    ( 5+STATUS)
  29. #define INS_ON           ( 6+STATUS)
  30. #define CAPSLOCK_ON      ( 7+STATUS)
  31. #define NUMLOCK_ON       ( 8+STATUS)
  32.  
  33. #define SYSREQ_PRESSED   ( 9+STATUS)
  34. #define CAPSLOCK_PRESSED (10+STATUS)
  35. #define NUMLOCK_PRESSED  (11+STATUS)
  36. #define SCROLL_PRESSED   (12+STATUS)
  37. #define R_ALT_PRESSED    (13+STATUS)
  38. #define R_CTRL_PRESSED   (14+STATUS)
  39. #define L_ALT_PRESSED    (15+STATUS)
  40. #define L_CTRL_PRESSED   (16+STATUS)
  41.  
  42. #define ALT_ESC         1 EXTENDED
  43. #define CTRL_A        1
  44. #define CTRL_B        2
  45. #define BREAK_KEY    3
  46. #define CTRL_@             3 EXTENDED
  47. #define CTRL_C        3
  48. #define CTRL_D        4
  49. #define CTRL_E        5
  50. #define CTRL_F        6
  51. #define CTRL_G        7
  52. #define CTRL_H        8
  53. #define BACKSPACE    8
  54. #define TAB        9
  55. #define CTRL_I        9
  56. #define CTRL_J        10
  57. #define CTRL_K        11
  58. #define CTRL_L            12
  59. #define CTRL_M        13
  60. #define ENTER        13
  61. #define ALT_BACK        14 EXTENDED
  62. #define CTRL_N        14
  63. #define SHIFT_TAB       15 EXTENDED
  64. #define CTRL_O           15
  65. #define ALT_Q           16 EXTENDED
  66. #define CTRL_P        16
  67. #define ALT_W           17 EXTENDED
  68. #define CTRL_Q        17
  69. #define ALT_E           18 EXTENDED
  70. #define CTRL_R        18
  71. #define ALT_R           19 EXTENDED
  72. #define CTRL_S        19
  73. #define ALT_T           20 EXTENDED
  74. #define CTRL_T        20
  75. #define ALT_Y           21 EXTENDED
  76. #define CTRL_U        21
  77. #define ALT_U           22 EXTENDED
  78. #define CTRL_V        22
  79. #define ALT_I           23 EXTENDED
  80. #define CTRL_W        23
  81. #define ALT_O           24 EXTENDED
  82. #define CTRL_X        24
  83. #define ALT_P           25 EXTENDED
  84. #define CTRL_Y        25
  85. #define ALT_LBRACKET    26 EXTENDED
  86. #define CTRL_Z        26
  87. #define ALT_RBRACKET    27 EXTENDED
  88. #define ESC            27
  89. #define CTRL_LBRACKET   27
  90. #define ALT_ENTER       28 EXTENDED
  91. #define CTRL_BACKSLASH  28
  92. #define CTRL_RBRACKET   29
  93. #define ALT_A           30 EXTENDED
  94. #define CTRL_CARAT      30
  95. #define ALT_S           31 EXTENDED
  96. #define CTRL__            31
  97. #define ALT_D           32 EXTENDED
  98. #define SPACEBAR        32
  99. #define ALT_F           33 EXTENDED
  100. #define ALT_G           34 EXTENDED
  101. #define ALT_H           35 EXTENDED
  102. #define ALT_J           36 EXTENDED
  103. #define ALT_K           37 EXTENDED
  104. #define ALT_L           38 EXTENDED
  105. #define ALT_SEMICOLON   39 EXTENDED
  106. #define ALT_APOSTROPHE  40 EXTENDED
  107. #define ALT_ACCENT      41 EXTENDED
  108. #define ALT_BSLASH      43 EXTENDED
  109. #define ALT_Z           44 EXTENDED
  110. #define ALT_X           45 EXTENDED
  111. #define ALT_C           46 EXTENDED
  112. #define ALT_V           47 EXTENDED
  113. #define ALT_B           48 EXTENDED
  114. #define ALT_N           49 EXTENDED
  115. #define ALT_M           50 EXTENDED
  116. #define ALT_COMMA       51 EXTENDED
  117. #define ALT_PERIOD      52 EXTENDED
  118. #define ALT_SLASH       53 EXTENDED
  119. #define ALT_ASTERIK     55 EXTENDED
  120. #define ALT_BREAK       56 EXTENDED
  121. #define CAPSLOCK        58 EXTENDED /* To catch this press use STATUS  */
  122. #define F1             59 EXTENDED
  123. #define F2              60 EXTENDED
  124. #define F3              61 EXTENDED
  125. #define F4              62 EXTENDED
  126. #define F5              63 EXTENDED
  127. #define F6              64 EXTENDED
  128. #define F7              65 EXTENDED
  129. #define F8              66 EXTENDED
  130. #define F9              67 EXTENDED
  131. #define F10             68 EXTENDED
  132. #define NUMLOCK            69 EXTENDED /* To catch this press use STATUS  */
  133. #define SCROLL_LOCK     70 EXTENDED /* To catch this press use STATUS  */
  134. #define HOME            71 EXTENDED
  135. #define UP            72 EXTENDED
  136. #define PGUP            73 EXTENDED
  137. #define ALT_NUM_MINUS   74 EXTENDED
  138. #define LEFT            75 EXTENDED
  139. #define CENTER          76 EXTENDED
  140. #define RIGHT           77 EXTENDED
  141. #define ALT_NUM_PLUS    78 EXTENDED
  142. #define END             79 EXTENDED
  143. #define DOWN            80 EXTENDED
  144. #define PGDN            81 EXTENDED
  145. #define INS             82 EXTENDED
  146. #define DEL             83 EXTENDED
  147. #define SHIFT_F1        84 EXTENDED
  148. #define SHIFT_F2        85 EXTENDED
  149. #define SHIFT_F3        86 EXTENDED
  150. #define SHIFT_F4        87 EXTENDED
  151. #define SHIFT_F5        88 EXTENDED
  152. #define SHIFT_F6        89 EXTENDED
  153. #define SHIFT_F7        90 EXTENDED
  154. #define SHIFT_F8        91 EXTENDED
  155. #define SHIFT_F9        92 EXTENDED
  156. #define SHIFT_F10       93 EXTENDED
  157. #define CTRL_F1         94 EXTENDED
  158. #define CTRL_F2         95 EXTENDED
  159. #define CTRL_F3         96 EXTENDED
  160. #define CTRL_F4         97 EXTENDED
  161. #define CTRL_F5         98 EXTENDED
  162. #define CTRL_F6         99 EXTENDED
  163. #define CTRL_F7        100 EXTENDED
  164. #define CTRL_F8        101 EXTENDED
  165. #define CTRL_F9        102 EXTENDED
  166. #define CTRL_F10       103 EXTENDED
  167. #define ALT_F1         104 EXTENDED
  168. #define ALT_F2         105 EXTENDED
  169. #define ALT_F3         106 EXTENDED
  170. #define ALT_F4         107 EXTENDED
  171. #define ALT_F5         108 EXTENDED
  172. #define ALT_F6         109 EXTENDED
  173. #define ALT_F7         110 EXTENDED
  174. #define ALT_F8         111 EXTENDED
  175. #define ALT_F9         112 EXTENDED
  176. #define ALT_F10        113 EXTENDED
  177. #define CTRL_PRINT     114 EXTENDED
  178. #define CTRL_LEFT      115 EXTENDED
  179. #define CTRL_RIGHT     116 EXTENDED
  180. #define CTRL_END       117 EXTENDED
  181. #define CTRL_PGDN      118 EXTENDED
  182. #define CTRL_HOME      119 EXTENDED
  183. #define ALT_1          120 EXTENDED
  184. #define ALT_2          121 EXTENDED
  185. #define ALT_3          122 EXTENDED
  186. #define ALT_4          123 EXTENDED
  187. #define ALT_5          124 EXTENDED
  188. #define ALT_6          125 EXTENDED
  189. #define ALT_7          126 EXTENDED
  190. #define ALT_8          127 EXTENDED
  191. #define DELETE           127
  192. #define ALT_9          128 EXTENDED
  193. #define ALT_0          129 EXTENDED
  194. #define ALT_MINUS      130 EXTENDED
  195. #define ALT_EQUAL      131 EXTENDED
  196. #define CTRL_PGUP      132 EXTENDED
  197. #define F11            133 EXTENDED
  198. #define F12            134 EXTENDED
  199. #define SHIFT_F11      135 EXTENDED
  200. #define SHIFT_F12      136 EXTENDED
  201. #define CTRL_F11       137 EXTENDED
  202. #define CTRL_F12       138 EXTENDED
  203. #define ALT_F11        139 EXTENDED
  204. #define ALT_F12        140 EXTENDED
  205. #define CTRL_UP        141 EXTENDED
  206. #define CTRL_NUM_MINUS 142 EXTENDED
  207. #define CTRL_NUM_PLUS  144 EXTENDED
  208. #define CTRL_DOWN      145 EXTENDED
  209. #define CTRL_INS       146 EXTENDED
  210. #define CTRL_DEL       147 EXTENDED
  211. #define CTRL_NUM_SLASH    149 EXTENDED
  212. #define CTRL_NUM_ASTERICK 150 EXTENDED
  213. #define ALT_HOME       151 EXTENDED
  214. #define ALT_UP         152 EXTENDED
  215. #define ALT_PGUP       153 EXTENDED
  216. #define ALT_LEFT       155 EXTENDED
  217. #define ALT_RIGHT      157 EXTENDED
  218. #define ALT_END           159 EXTENDED
  219. #define ALT_DOWN       160 EXTENDED
  220. #define ALT_PGDN       161 EXTENDED
  221. #define ALT_INS        162 EXTENDED
  222. #define ALT_DEL        163 EXTENDED
  223. #define ALT_NUM_SLASH  164 EXTENDED
  224. #define ALT_TAB        165 EXTENDED
  225. #define ALT_NUM_ENTER  166 EXTENDED
  226.